<%- partial('sidebar') %>

<div id="content">
  <div class="panel">
    <div class="header">
      <% [['all', '全部'], ['good', '精华']].concat(tabs).forEach(function (pair) {
        var value = pair[0];
        var text = pair[1]; %>
        <a href="<%= value ? '/?tab=' + value : '/' %>"
          class="topic-tab <%= value === tab ? 'current-tab' : '' %>"><%= text %></a>
      <% }) %>
    </div>
    <% if (typeof(topics) !== 'undefined' && topics.length > 0) { %>
    <div class="inner no-padding">
      <%- partial('topic/list', {
      topics: topics,
      pages: pages,
      current_page: current_page,
      base: '/'
      }) %>
    </div>
    <% } else { %>
    <div class="inner">
      <p>无话题</p>
    </div>
    <% } %>
  </div>
</div>
